package com.jike.noobmoney.mvp.view.activity;

import android.app.Activity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.jike.noobmoney.R;
import com.jike.noobmoney.contants.ConstantValue;
import com.jike.noobmoney.util.AppInfoUtils;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.OnClick;
import me.iwf.photopicker.PhotoPreview;

public class ShowImageActivity extends BaseActivity {

    @BindView(R.id.img_show)
    ImageView img_show;

    public String image;
    @Override
    protected int layoutResID() {
        return R.layout.activity_show_image;
    }

    @Override
    protected void initData() {
       image= getIntent().getStringExtra("img");
        Glide.with(context).load(image).into(img_show);
    }

    @OnClick({R.id.tv_back,R.id.tv_save})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_back:
                finish();
                break;
            case R.id.tv_save:
                String url = image;
                ArrayList<String> photoPaths = new ArrayList<>();
                photoPaths.add(url);
                PhotoPreview.builder()
                        .setPhotos(photoPaths)
                        .setCurrentItem(0)
                        .setShowDeleteButton(true)
                        .start((Activity) context);
                    break;
        }
    }
}
